package Login;

import java.awt.CardLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;


public class MainFrame extends JFrame {
	
	private JPanel cards;
	private CardLayout cl;
	private MainPane mainPane;
	private ModePane modePane;
	private LoginPane loginPane;
	
	public MainFrame(){
		cards=new JPanel(cl=new CardLayout());
		LoginPane loginPane2, loginPane3;
		
		mainPane = new MainPane(cards, 1, cl);
		modePane = new ModePane(cards, 2, cl);
		loginPane = new LoginPane(cards, 3, cl, "images/loginb.png");
		loginPane2 = new LoginPane(cards, 4, cl, "images/logina.png");
		loginPane3 = new LoginPane(cards, 5, cl, "images/loginc.png");
		
		cards.add(mainPane, "1");
		cards.add(modePane, "2");
		cards.add(loginPane, "3");
		cards.add(loginPane2, "4");
		cards.add(loginPane3, "5");
		
		
		createFrame();
	}
	
	public void createFrame(){
		
		JFrame frame = new JFrame("NiSoft");
		frame.add(cards);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(cards.getPreferredSize());
		frame.setLocationRelativeTo(null);
	 	
	}

	public static void main(String[] args){
		new MainFrame();
		/*
		JFrame frame = new JFrame("NiSoft");
		frame.add(new LoginPane(null, 1, null));
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(515, 375+38);
		frame.setLocationRelativeTo(null);
	 	
		*/
	}

}
